﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using Blog.DataAccess;
using Blog.Entity;

[assembly: CLSCompliant(true)]
namespace Blog.Business
{
    public class UserBusiness
    {
        private DataConnection connection=new DataConnection();
        public User GetInfoUser(string username)
        {
            var sql = "";
            var dataTable = connection.GetDataTable(sql);
            var user=new User();
            if(dataTable.Rows.Count>0)
            {
                var dataRow = dataTable.Rows[0];
                user.FullName = dataRow["FullName"].ToString();
                user.Birthday = dataRow["Birthday"].ToString();
                user.Address = dataRow["Address"].ToString();
                user.UserName = dataRow["UserName"].ToString();
                user.Password = dataRow["Password"].ToString();
            }
            else
            {
                user.FullName = "";
                user.Birthday = "";
                user.Address = "";
                user.UserName = "";
                user.Password = "";
            }
            return user;
        }

        //public bool ChangePassword(string password)
        //{
        //    //password=
        //}
    }
}
